﻿using System;
using System.Linq;
using System.Text;
using DevExpress.Xpo;
using DevExpress.ExpressApp;
using System.ComponentModel;
using DevExpress.ExpressApp.DC;
using DevExpress.Data.Filtering;
using DevExpress.Persistent.Base;
using System.Collections.Generic;
using DevExpress.ExpressApp.Model;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Persistent.Validation;

namespace Marbid.Module.BusinessObjects.CRM
{
   [DefaultClassOptions]
   //[ImageName("BO_Contact")]
   //[DefaultProperty("DisplayMemberNameForLookupEditorsOfThisType")]
   //[DefaultListViewOptions(MasterDetailMode.ListViewOnly, false, NewItemRowPosition.None)]
   //[Persistent("DatabaseTableName")]
   // Specify more UI options using a declarative approach (https://documentation.devexpress.com/#eXpressAppFramework/CustomDocument112701).
   public class BusinessTransactionSummary : BaseObject
   { // Inherit from a different class to provide a custom primary key, concurrency and deletion behavior, etc. (https://documentation.devexpress.com/eXpressAppFramework/CustomDocument113146.aspx).
      public BusinessTransactionSummary(Session session)
          : base(session)
      {
      }
      public override void AfterConstruction()
      {
         base.AfterConstruction();
         // Place your initialization code here (https://documentation.devexpress.com/eXpressAppFramework/CustomDocument112834.aspx).
      }
      //private string _PersistentProperty;
      //[XafDisplayName("My display name"), ToolTip("My hint message")]
      //[ModelDefault("EditMask", "(000)-00"), Index(0), VisibleInListView(false)]
      //[Persistent("DatabaseColumnName"), RuleRequiredField(DefaultContexts.Save)]
      //public string PersistentProperty {
      //    get { return _PersistentProperty; }
      //    set { SetPropertyValue("PersistentProperty", ref _PersistentProperty, value); }
      //}

      //[Action(Caption = "My UI Action", ConfirmationMessage = "Are you sure?", ImageName = "Attention", AutoCommit = true)]
      //public void ActionMethod() {
      //    // Trigger a custom business logic for the current record in the UI (https://documentation.devexpress.com/eXpressAppFramework/CustomDocument112619.aspx).
      //    this.PersistentProperty = "Paid";

      Company company;
      [Association("Company-BusinessTransactionSummary")]
      public Company Company
      {
         get
         {
            return company;
         }
         set
         {
            SetPropertyValue("Company", ref company, value);
         }
      }

      DateTime accountingDate;
      public DateTime AccountingDate
      {
         get
         {
            return accountingDate;
         }
         set
         {
            SetPropertyValue("AccountingDate", ref accountingDate, value);
         }
      }

      int accountingYear;
      public int AccountingYear
      {
         get
         {
            return accountingYear;
         }
         set
         {
            SetPropertyValue("AccountingYear", ref accountingYear, value);
         }
      }

      int accountingQuarter;
      public int AccountingQuarter
      {
         get
         {
            return accountingQuarter;
         }
         set
         {
            SetPropertyValue("AccountingQuarter", ref accountingQuarter, value);
         }
      }

      double classOfBusiness;
      public double ClassOfBusiness
      {
         get
         {
            return classOfBusiness;
         }
         set
         {
            SetPropertyValue("ClassOfBusiness", ref classOfBusiness, value);
         }
      }

      double kindOfBusiness;
      public double KindOfBusiness
      {
         get
         {
            return kindOfBusiness;
         }
         set
         {
            SetPropertyValue("KindOfBusiness", ref kindOfBusiness, value);
         }
      }

      double grossClaim;
      public double GrossClaim
      {
         get
         {
            return grossClaim;
         }
         set
         {
            SetPropertyValue("GrossClaim", ref grossClaim, value);
         }
      }

      double grossCommission;
      public double GrossCommission
      {
         get
         {
            return grossCommission;
         }
         set
         {
            SetPropertyValue("GrossCommission", ref grossCommission, value);
         }
      }
   }
}